home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / a_man / cat7 / input.z / input
Encoding:
Text File  |  2002-10-03  |  21.1 KB  |  463 lines

  1.  
  2.  
  3.  
  4. IIIINNNNPPPPUUUUTTTT((((7777))))                                                              IIIINNNNPPPPUUUUTTTT((((7777))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      input - input devices
  10.  
  11. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  12.      The IRIX operating system includes support for a number of input devices,
  13.      and support for additional devices can be added.
  14.  
  15.      Standard input devices include the keyboard and mouse.  Installing the
  16.      "Optional Input Devices" (eoe.sw.optinput) software adds support for the
  17.      following optional input devices:
  18.  
  19.      ++++oooo    Calcomp tablets. (Module Name: _c_a_l_c_o_m_p, X Name: _t_a_b_l_e_t)
  20.  
  21.      ++++oooo    Hitachi HDG-J tablets. (Module Name: _h_i_t_a_c_h_i, X Name: _h_i_t_a_c_h_i)
  22.  
  23.      ++++oooo    Other Hitachi tablets. (Module Name: _t_a_b_l_e_t, X Name: _t_a_b_l_e_t)
  24.  
  25.      ++++oooo    Wacom tablets. (Module Name: _w_a_c_o_m, X Name: _w_a_c_o_m)
  26.  
  27.      ++++oooo    The dial box. (Module Name: _d_i_a_l_b_o_x, X Name: _d_i_a_l_b_o_x)
  28.  
  29.      ++++oooo    The dial and button box combination. (Module Name: _d_i_a_l, X Name:
  30.           _d_i_a_l+_b_u_t_t_o_n_s)
  31.  
  32.      ++++oooo    Imp infra-red presentation mouse. (Module Name: _i_m_p, X Name: _i_m_p)
  33.  
  34.      ++++oooo    Logitech Magellan 3D controller. (Module Name: _m_a_g_e_l_l_a_n, X Name:
  35.           _m_a_g_e_l_l_a_n)
  36.  
  37.      ++++oooo    Space ball. (Module Name: _s_b_a_l_l, X Name: _s_p_a_c_e_b_a_l_l)
  38.  
  39.      Application programs access these devices using the X Input Extension.
  40.  
  41.      The drivers for these devices are implemented as loadable STREAMS modules
  42.      (see _m_l(_1_m)).  They handle device initialization and generate input
  43.      events in response to input from the devices.  A driver will only be
  44.      loaded into the kernel when the corresponding device is opened for use.
  45.  
  46.    CCCCOOOONNNNFFFFIIIIGGGGUUUURRRRIIIINNNNGGGG AAAA DDDDEEEEVVVVIIIICCCCEEEE FFFFOOOORRRR UUUUSSSSEEEE
  47.      The easiest way to set up an optional input device is to use the visual
  48.      system adminstration tool _S_e_r_i_a_l_D_e_v_i_c_e_M_a_n_a_g_e_r(_1_m) which is normally
  49.      accessed via the _T_o_o_l_c_h_e_s_t(_1)'_s SSSSyyyysssstttteeeemmmm section, through the System
  50.      Manager tool.
  51.  
  52.      The X server looks for input devices by scanning the directory
  53.      ////ddddeeeevvvv////iiiinnnnppppuuuutttt.  Instead of using the _S_e_r_i_a_l_D_e_v_i_c_e_M_a_n_a_g_e_r(_1_m), you can create
  54.      a link in this directory to the device special file associated with the
  55.      serial port the device is connected to.  The name of the link must be the
  56.      same as the streams module name for the desired input device.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. IIIINNNNPPPPUUUUTTTT((((7777))))                                                              IIIINNNNPPPPUUUUTTTT((((7777))))
  71.  
  72.  
  73.  
  74.      Note that the _S_e_r_i_a_l_D_e_v_i_c_e_M_a_n_a_g_e_r will check various configuration files
  75.      and force you to remove other devices configured on a port before
  76.      allowing you to assign an input device to it.  If you create the input
  77.      device file yourself, you must ensure that no other devices or programs
  78.      are associated with the port in question.
  79.  
  80.    CCCCUUUUSSSSTTTTOOOOMMMM IIIINNNNPPPPUUUUTTTT DDDDEEEEVVVVIIIICCCCEEEESSSS
  81.      Support for custom X input devices can be added.  First a STREAMS module
  82.      for the device must be written; the subsystem x_dev.src.examples installs
  83.      sample driver code in /_u_s_r/_s_h_a_r_e/_s_r_c/_X/_i_n_p_u_t/_d_r_i_v_e_r_s. The device can then
  84.      be configured to work with the _S_e_r_i_a_l_D_e_v_i_c_e_M_a_n_a_g_e_r by performing the
  85.      following actions.
  86.  
  87.      An _f_t_r file (see _f_f_t_r(1)) for the device must be created in
  88.      /_u_s_r/_l_i_b/_f_i_l_e_t_y_p_e/_v_a_d_m_i_n/_p_o_r_t_s.  For example, an ftr file for the dial
  89.      and button box might appear as follows:
  90.  
  91.           TYPE DialAndButton
  92.                MATCH       false;
  93.                LEGEND      DialAndButton
  94.                ICON {
  95.                     include("iconlib/DialAndButton.fti");
  96.                }
  97.  
  98.      "DialAndButton" should be replaced with a unique type name for the
  99.      device.  The icon description may be included from the
  100.      /_u_s_r/_l_i_b/_f_i_l_e_t_y_p_e/_v_a_d_m_i_n/_p_o_r_t_s/_i_c_o_n_l_i_b directory, as shown.  After this
  101.      file is created, the following commands must be executed:
  102.  
  103.           % cd /usr/lib/filetype
  104.           % make
  105.  
  106.      A file must also be created in the /_u_s_r/_l_i_b/_X_1_1/_i_n_p_u_t/_i_n_s_t_a_l_l_e_d
  107.      directory.  This file must have the same name as the streams module for
  108.      the device.  The first line in this file should be the string which will
  109.      identify the device for the user.  The second line should be the type
  110.      name as given in the ftr file.  Blank lines and lines that begin with the
  111.      character '#' are ignored.
  112.  
  113.      For example, the file for the dial and button device might appear as
  114.      follows:
  115.  
  116.           # Icon label
  117.           Dials & Buttons
  118.  
  119.           # Icon type
  120.           DialAndButton
  121.  
  122.    DDDDEEEEVVVVIIIICCCCEEEE CCCCOOOONNNNTTTTRRRROOOOLLLLSSSS
  123.      Device controls form an extensible mechanism for changing or querying
  124.      device characteristics.  They fall into two categories:  those
  125.      intercepted by the X server (_x__i_n_i_t controls) and those handled by the
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. IIIINNNNPPPPUUUUTTTT((((7777))))                                                              IIIINNNNPPPPUUUUTTTT((((7777))))
  137.  
  138.  
  139.  
  140.      device drivers (_d_e_v_i_c_e__i_n_i_t controls).  The X server handles the _x__i_n_i_t
  141.      controls, which change the way the server views devices.  The device
  142.      drivers handle the _d_e_v_i_c_e__i_n_i_t controls, which change device
  143.      characteristics.
  144.  
  145.      Device controls can be permanently configured by storing them in files
  146.      which reside in the directory ////uuuussssrrrr////lllliiiibbbb////XXXX11111111////iiiinnnnppppuuuutttt////ccccoooonnnnffffiiiigggg.
  147.  
  148.      The _d_e_v_i_c_e__i_n_i_t controls must be placed in a file with the same name as
  149.      the streams module for the device (which is also the name of the link
  150.      created in /_d_e_v/_i_n_p_u_t).  The format is as follows:
  151.  
  152.           device_init {
  153.                control "argument"
  154.                control "argument"
  155.                ...
  156.           }
  157.  
  158.      The _x__i_n_i_t controls must be placed in a file with the X name of the
  159.      device (as supplied by the streams module).  The format is as follows:
  160.  
  161.           x_init {
  162.                control "argument"
  163.                control "argument"
  164.                ...
  165.           }
  166.  
  167.      If the streams module name and the X name are the same, _d_e_v_i_c_e__i_n_i_t and
  168.      _x__i_n_i_t controls may be placed in the same file.  The device control
  169.      arguments must be enclosed in quotation marks.
  170.  
  171.      You can also issue device controls dynamically by calling
  172.      _X_S_G_I_D_e_v_i_c_e_C_o_n_t_r_o_l(_3_X_1_1) from within a program.  The current setting of a
  173.      device control can be queried by using _X_S_G_I_D_e_v_i_c_e_Q_u_e_r_y(_3_X_1_1).
  174.  
  175.      The sample program _d_e_v_c_t_r_l can be used to issue or query device controls
  176.      from a command line prompt or script.  The source for this program is
  177.      installed in /_u_s_r/_s_h_a_r_e/_s_r_c/_X/_i_n_p_u_t/_c_l_i_e_n_t_s by "X11 Source Code Examples"
  178.      (x_dev.src.examples).
  179.  
  180.    DDDDEEEEVVVVIIIICCCCEEEE IIIINNNNIIIITTTTIIIIAAAALLLLIIIIZZZZAAAATTTTIIIIOOOONNNN
  181.      The X server looks for new devices both at initialization time and when a
  182.      client requests a list of devices.  When it finds a new device, it:
  183.  
  184.      ++++oooo    opens the device and loads the streams module
  185.  
  186.      ++++oooo    issues device_init controls
  187.  
  188.      ++++oooo    asks the device to describe itself
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. IIIINNNNPPPPUUUUTTTT((((7777))))                                                              IIIINNNNPPPPUUUUTTTT((((7777))))
  203.  
  204.  
  205.  
  206.      ++++oooo    issues x_init controls
  207.  
  208.      ++++oooo    closes the device unless autostart (see below) is on
  209.  
  210.      When some program opens a device that is not autostarted nor open by some
  211.      other program, the X server:
  212.  
  213.      ++++oooo    opens the device and loads the streams module
  214.  
  215.      ++++oooo    issues device_init controls
  216.  
  217.      ++++oooo    issues x_init controls
  218.  
  219.      ++++oooo    starts reporting events from the device
  220.  
  221.    XXXX____IIIINNNNIIIITTTT CCCCOOOONNNNTTTTRRRROOOOLLLLSSSS
  222.      The X server intercepts the following _x__i_n_i_t controls:
  223.  
  224.      aaaauuuuttttoooossssttttaaaarrrrtttt "on"/"off"
  225.           Specifies whether ("on") or not ("off") the device is opened
  226.           automatically by the X server.  Extension devices are normally
  227.           ignored until some client explicitly opens them, but you can change
  228.           that using this directive.  This allows you to use several devices
  229.           to control the cursor simultaneously without explicitly opening the
  230.           extension devices you wish to use.
  231.  
  232.      kkkkeeeeyyyymmmmaaaapppp <_k_e_y_m_a_p _n_a_m_e>
  233.           Not implemented, but reserved (and intercepted).
  234.  
  235.      mmmmoooottttiiiioooonnnnhhhhiiiisssstttt <_e_v_e_n_t _c_o_u_n_t>
  236.           Specifies the maximum number of events to keep in a motion history
  237.           buffer for the device.  This buffer is accessed using the X Input
  238.           Extension request XGetDeviceMotionEvents.  The default size is 0.
  239.           The maximum size is 2048 events.
  240.  
  241.      nnnnaaaammmmeeee <_n_e_w _n_a_m_e>
  242.           Renames the device.   This changes the name of the device as
  243.           reported by the X Input Extension.
  244.  
  245.      ppppuuuusssshhhhppppooooiiiinnnntttteeeerrrr "on"/"off"/"exclusive"
  246.           Controls whether or not the device generates core pointer events as
  247.           well as extension events.   "on" means generate both,  "off" means
  248.           generate extension events only and "exclusive" means generate core
  249.           events for two axes and extension events for the rest of them.
  250.  
  251.      ppppuuuusssshhhhxxxx <_a_x_i_s _n_u_m_b_e_r>
  252.           Specifies the device axis which generates the X position in core
  253.           pointer events if pushpointer is "on" or "exclusive".
  254.  
  255.      ppppuuuusssshhhhyyyy <_a_x_i_s _n_u_m_b_e_r>
  256.           Specifies the device axis which generates the Y position in core
  257.           pointer events if pushpointer is "on" or "exclusive".
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. IIIINNNNPPPPUUUUTTTT((((7777))))                                                              IIIINNNNPPPPUUUUTTTT((((7777))))
  269.  
  270.  
  271.  
  272.      ssssccccaaaalllleeee "iso"/"fit"/"none"
  273.           Tells the X server how to scale the device the next time it is
  274.           opened.   Scale "iso" uses the full range of either the X or Y axis
  275.           but preserves a 1 to 1 aspect ratio. Scale "fit" uses the full range
  276.           of both axes (aspect ratio may be skewed).   Scale "none" uses raw
  277.           device data.   Unless you're supporting a tablet, you probably want
  278.           scale "none".
  279.  
  280.      ssssccccaaaalllleeeewwwwhhhhiiiicccchhhh "allvals"/"novals"/"ptrvals"/"ptr"/"noptr"/"none"
  281.           Specifies the axes and events affected by the ssssccccaaaalllleeee control.
  282.           Scalewhich "allvals" scales all extension device valuators
  283.           (meaningless for scale-to-fit). Scalewhich "novals" doesn't scale
  284.           any extension device valuators.   Scalewhich "ptrvals" scales only
  285.           the extension valuators which correspond to the core pointer X and Y
  286.           axes.    Scalewhich "ptr" means to scale the core pointer X and Y
  287.           values and "noptr" means no to.   Scalewhich "none" means don't
  288.           scale anything.  The effects of this control are cumulative, so you
  289.           can issue several.
  290.  
  291.      ssssccccrrrreeeeeeeennnncccchhhhaaaannnnggggeeee "on"/"off"
  292.           For configurations where multiple screens are associated with a
  293.           single X server, specifies whether a change to a different screen
  294.           can be triggered by the device.  The default is "on" (screen changes
  295.           enabled) for all devices.  The device must be an active pointer
  296.           device (pushpointer "on" or "exclusive") in order to trigger a
  297.           screen change.
  298.  
  299.      ttttyyyyppppeeee <_n_e_w _t_y_p_e>
  300.           Changes the type of the device as reported by the X Input Extension.
  301.  
  302.    DDDDEEEEVVVVIIIICCCCEEEE____IIIINNNNIIIITTTT CCCCOOOONNNNTTTTRRRROOOOLLLLSSSS
  303.      Here are some of the more common _d_e_v_i_c_e__i_n_i_t controls.  Any control which
  304.      changes the observed characteristics of the device should be issued only
  305.      as a _d_e_v_i_c_e__i_n_i_t control because the X server has already asked the
  306.      device to describe itself when it issues the _x__i_n_i_t controls and it will
  307.      not notice the changes.  "Observed chararcteristics" include number of
  308.      axes, buttons or keys or the range of the devices axes; they do nnnnooootttt
  309.      include controls which change the way that physical device events are
  310.      mapped onto X events.
  311.  
  312.      pppprrrreeeessssssssuuuurrrreeee "on"/"off"
  313.           For pressure sensitive tablets.   Start/stop reporting pressure (and
  314.           tilt/height in some cases) information.  This option adds axes (for
  315.           the pen pressure value) to a device, so it should be a _d_e_v_i_c_e__i_n_i_t
  316.           option.
  317.  
  318.      bbbbttttnnnnpppprrrreeeessssssssuuuurrrreeee <_p_r_e_s_s_u_r_e>
  319.           For pressure sensitive tablets.  Specifies the threshold above which
  320.           the tip pressure generates a button event.  Note that this is a raw
  321.           8 bit integer, *not* an ascii decimal number.  To set the tip button
  322.           pressure to '5', use '^E' (control-E), NOT '5'.  This option
  323.           controls the mapping of physical pressure events on to X button
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. IIIINNNNPPPPUUUUTTTT((((7777))))                                                              IIIINNNNPPPPUUUUTTTT((((7777))))
  335.  
  336.  
  337.  
  338.           events, but it does nnnnooootttt affect the observed characteristics of the
  339.           device.  It can safely be used as either an _x__i_n_i_t or a _d_e_v_i_c_e__i_n_i_t
  340.           option.
  341.  
  342.      iiiinnnnvvvveeeerrrrtttt <_a_x_e_s _t_o _i_n_v_e_r_t>
  343.           Where <axes to invert> is a (case sensitive) string of characters
  344.           which specifies the axes to be inverted.  An 'x' means invert the X
  345.           axis in core pointer events, a 'y' means invert the Y axis.  A
  346.           single digit '0'-'9' means invert the corresponding axis in
  347.           extension events.   A '!' in the string reverses the interpretation
  348.           of all following characters in the string.   For example "y1" means:
  349.           invert the Y axis in core events and axis 1 in extension events
  350.           (leave all other axes alone).   A "y!x" means: invert the Y axis in
  351.           core events but do not invert the X axis; in this case, extension
  352.           events are not affected.  Affects mapping only, so it can be either
  353.           _x__i_n_i_t or _d_e_v_i_c_e__i_n_i_t.
  354.  
  355.      lllleeeefffftttt////rrrriiiigggghhhhtttt////ttttoooopppp////bbbboooottttttttoooommmm <_o_f_f_s_e_t>
  356.           Primarily for tablet devices.  Specifies a dead margin (in raw
  357.           device coordinates) around the edges of the tablet.  These requests
  358.           change the apparent size of the tablet surface so they should be
  359.           device_init options only.
  360.  
  361.      mmmmaaaaxxxx[[[[xxxxXXXXyyyyYYYY0000----9999]]]] <_m_a_x_i_m_u_m _v_a_l_u_e>
  362.           Changes the maximum value for the corresponding valuators.   Note
  363.           that "maxx" and "maxy" change the axes that correspond to the core
  364.           pointer axes, not the core pointer events themselves.   In other
  365.           words, you can't use this request to get illegal core pointer events
  366.           (core pointer events are always restricted to the screen).
  367.           _d_e_v_i_c_e__i_n_i_t only.
  368.  
  369.      mmmmooooddddeeeellll <_v_e_n_d_o_r _s_p_e_c_i_f_i_c>
  370.           Specifies the model of the device so the driver can do model
  371.           specific things.   Unfortunately, probing a device from the kernel
  372.           is pretty messy, so we use this control in a configuration file to
  373.           specify the type of device attached (for now).  _d_e_v_i_c_e__i_n_i_t only.
  374.  
  375.      ssssccccaaaalllleeee[[[[xxxxXXXXyyyyYYYY0000----9999]]]] <_s_c_a_l_e _f_a_c_t_o_r>
  376.           Control scaling on an axis by axis basis.  To use this, first set
  377.           scalewhich _n_o_n_e in the X server so the X server doesn't clobber your
  378.           values.  For example:
  379.  
  380.           scalex "1/5"
  381.                scales core pointer x events by one fifth.
  382.  
  383.           scale4 "5"
  384.                scales extension valuator 4 events by 5.
  385.  
  386.           Note that changing scaling does not affect the range of the valuator
  387.           - extension valuators are clamped to the range of the device.   In
  388.           other words, if you scale a tablet axis by 5, you'll only be able to
  389.           use one-fifth of the tablets surface in the corresponding direction.
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. IIIINNNNPPPPUUUUTTTT((((7777))))                                                              IIIINNNNPPPPUUUUTTTT((((7777))))
  401.  
  402.  
  403.  
  404.           These affect mapping only, so they can be _d_e_v_i_c_e__i_n_i_t or _x__i_n_i_t.
  405.  
  406. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  407.      The calcomp tablet uses a streams module named "calcomp" but reports an X
  408.      name of "tablet".  The Drawing Pad II is 7" by 7" and has a resolution of
  409.      1000 points per inch.  To scale raw tablet events to screen coordinates
  410.      (1280x1024) we create /usr/lib/X11/input/config/tablet (name of X device)
  411.      with the contents:
  412.  
  413.      x_init {
  414.          scalewhich  "none"
  415.          scalex      "914/5000"
  416.          scaley      "914/5000"
  417.          scale0      "914/5000"
  418.          scale1      "914/5000"
  419.      }
  420.  
  421.  
  422.      To make the calcomp tablet control the cursor automatically, we would add
  423.      the lines:
  424.  
  425.      pushpointer    "on"
  426.      autostart      "on"
  427.  
  428.  
  429.      If we wanted a 1" margin around the tablet, we'd create a device_init
  430.      file (/usr/lib/X11/input/config/calcomp) with the contents:
  431.  
  432.      device_init {
  433.          left        "1000"
  434.          right       "1000"
  435.          top         "1000"
  436.          bottom      "1000"
  437.      }
  438.  
  439.  
  440.      Of course, this reduces the tablet surface by 2000 units in each
  441.      direction, so we'd have to recalculate scale[xy01] values for the x_init
  442.      options to get the mapping right.
  443.  
  444.      If we wanted to do the same thing for the Hitachi tablet, (streams module
  445.      == tablet, X name == tablet) we'd put both the x_init and device_init
  446.      sections in the same file (/usr/lib/X11/input/config/tablet).
  447.  
  448. FFFFIIIILLLLEEEESSSS
  449.      /dev/input/*
  450.      /usr/lib/X11/input/config/*
  451.  
  452. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  453.      SerialDeviceManager(1m), sysmgr(1m), mknod(1m), ml(1m),
  454.      XSGIDeviceControl(3X11), XSGIDeviceQuery(3X11), imp(7), hitachi(7)
  455.  
  456.  
  457.  
  458.  
  459.                                                                         PPPPaaaaggggeeee 7777
  460.  
  461.  
  462.  
  463.